<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="wst.aspx.vb" Inherits="WebServiceTester.Wst" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>SOLAR Web Service Portal</title>
    <link href="CustomCss.css" type="text/css" rel="stylesheet" />
     <script type="text/javascript">
    
    function LoadEvent()
    { 
        try 
        {   
            var elem = document.getElementById('{0}_SelectedNode');
            alert(elem.value);   
            if(elem != null )   
            {     
                var node = document.getElementById(elem.value);     
                if(node != null)     
                {       
                    node.scrollIntoView(true);       
                    Panel1.scrollLeft = 0;     
                }   
            } 
        } 
        catch(oException) 
        {}
    }// -->


    function setCookie(c_name,value,expiredays)
    {
        var exdate=new Date();
        exdate.setDate(exdate.getDate()+expiredays);
        document.cookie=c_name+ "=" +escape(value)+
        ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
    }
    
    
    function fGetWSDL()
    {
        setCookie('Url',document.all.item("txtUrl").value,60);
         document.getElementById('divEnum').style.display='none';
         document.getElementById('divValue').style.display='none';
         document.getElementById('divArray').style.display='none';
      __doPostBack('MainTab$TabPanelInvoke$updpnlTreeView','NodeClick|Go');
    
    }
    
    function fPopulateRequest(value)
    {
        //alert(value);
      __doPostBack('updpnlRequest','NodeClick|' + value);
     
    }

   
  function fOnLoad()
  {
    document.getElementById('txtUrl').focus();
  }

  function fPopulateFieldValue(value,nodevalue,nodetext, IsArray, IsEnum, EnumArgs)
    {
        if(IsArray=='True')
        {
            document.getElementById('divArray').style.display='block';
            document.getElementById('divValue').style.display='none';
            document.getElementById('txtArrayLength').value = '';
            document.getElementById('txtArrayLength').focus();
            
            
        }
        else
        {
            document.getElementById('divArray').style.display='none';
            document.getElementById('divValue').style.display='block';
            document.getElementById('txtValue').value  = '';
            document.getElementById('txtValue').focus();

        }
        
        if(IsEnum=='True')
        {

          
            document.getElementById('divEnum').style.display='block';
            document.getElementById('divValue').style.display='none';
            var Enum = document.getElementById('selectEnum');
          
            var aryEnums = EnumArgs.split(",");
            var i;
           
            document.forms[0].selectEnum.options.length = 0 
            document.forms[0].selectEnum.options.length ++;
            document.forms[0].selectEnum.options[0].value = '';
            document.forms[0].selectEnum.options[0].text = '';
            // loops through the array adding item text/value 
            for(var i=0;i<aryEnums.length -1;i++)
            {
            document.forms[0].selectEnum.options.length ++;
            document.forms[0].selectEnum.options[i+1].value = aryEnums[i];
            document.forms[0].selectEnum.options[i+1].text = aryEnums[i];
            }
 
            
            document.forms[0].selectEnum.options[0].selected='selected';
            
        }
        else
        {
            document.getElementById('divEnum').style.display='none';
        }
        
        document.getElementById('txtXPath').value = value;
        document.getElementById('txtNodeText').value  = nodetext;
         
    }

   function fUpdateArrayField(value)
   {
  
        __doPostBack('MainTab$TabPanelInvoke$updpnlRequest','AddArrayField|' + value + "|" + document.getElementById("txtXPath").value);   
   }
    
   function fUpdateFieldValue(value)
   {
        
    __doPostBack('MainTab$TabPanelInvoke$updpnlRequest','AssignValue|' + value + "|" + document.getElementById("txtXPath").value);

   }
  
    function fInvoke()
    {
        
        if(document.all.item("txtUrl").value=="")
        {
            return;
        }
        __doPostBack('MainTab$TabPanelInvoke$updpnlRequest','Invoke|' + document.getElementById("txtValue").value + "|" + document.getElementById("txtXPath").value);     

      
      
    }
    
    
    function fSendRequest()
    {
      __doPostBack('MainTab$TabPanelSend$updpnlSend','Send|');        
    
    }
    
    function fCreateSampleRequest()
    {
      __doPostBack('MainTab$TabPanelSend$updpnlSend','Sample|');        
    
    }
      function fSearch()
    {
      __doPostBack('MainTab$TabPanelSearch$updpnlSearchResult','Search|');        
    
    }
    
    
    </script>
    
</head>
<body bgcolor="#6699cc" onload="fOnLoad();">
    <form id="form1" runat="server" >
        <asp:ScriptManager ID="ScriptManager1" runat="server"   />
       
        
        <asp:Panel ID="Panel4" runat="server" Height="140px" Width="100%" CssClass="Style1">
       
             
       <table width="100%">
       <tr>
       <td width="10%" align="left" valign="top"></td>
       <td align="center" valign="middle" ><span class="FontStyle2">SOLAR Web Service Tester</span>
           </td>
       <td width="10%" align="right" valign="top"><asp:Image ID="Image5" runat="server" ImageUrl="~/amexlogo.bmp"  /></td>
       </tr>
           <tr>
               <td  align="left"  valign="middle" style="height: 31px" >
                   <span class="FontStyle1">Wsdl EndPoint</span>  
               </td>
        <td width="40%"  valign="middle"  align="left" style="height: 31px">
            <asp:TextBox ID="txtUrl" Font-Bold="False"  runat="server" Width="98%" CssClass="FontStyle" ToolTip="Enter the URL of the Web Service"></asp:TextBox></td>
        <td valign="middle" align="left" style="" >
        <!-- <img id="btnGo" src="cooltext92009660.png" onmouseover="this.src='cooltext92009660MouseOver.png';" onmouseout="this.src='cooltext92009660.png';" onclick="fGetWSDL();" style="height:31px;width:31px" /> -->
         <input id="btnGo" type="button" class="FontStyle" value="Go" onclick="fGetWSDL();" tabindex="1" style="background-image: url(btnGo.png)" />  <!--<asp:Button ID="btnGo" Text="Go" runat="server"  /> -->
        </td> 
        </tr>
        <tr>
        <td valign="top" align="left">
                <span class="FontStyle1" >Select Certificates </span>
        </td>
        <td  valign="top" align="left">
        <table>
        <tr>
        <td> 
        <asp:UpdatePanel ID="updpnlCertificates" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
            <asp:DropDownList ID="ddlbCertificates" CssClass="FontStyle" runat="server" Width="265px" ToolTip="Select Certificate if a secured URL is used" >
            </asp:DropDownList>
            </ContentTemplate>
        </asp:UpdatePanel>
        </td>
        <td width="10%"></td>
        <td> 
        <asp:UpdatePanel ID="updpnlResponseTime" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                   <span class="FontStyle1" >Response Time  </span>
                   <asp:Label ID="lblResponseTime" runat="server" CssClass="FontStyle" ForeColor="Red"></asp:Label></ContentTemplate>
            </asp:UpdatePanel>
        </td>
        </tr>
        </table>
        </td>
        <td>
        </td>
        </tr>
        </table>
      </asp:Panel>    
      <cc1:TabContainer ID="MainTab" runat="server" ActiveTabIndex="0" BorderColor="White" CssClass="visoft__tab_xpie7" width="100%" Height="550px" BackColor="GreenYellow">
            <cc1:TabPanel ID="TabPanelInvoke"  HeaderText="TabPanel1" runat="server" width="100%"  Height="500px" BackColor="DarkGray"  >
            <ContentTemplate>
             <table>
             <tr>
             <td align="left" valign="top" >
             <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0">
                <ProgressTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/loading.gif" />
                </ProgressTemplate>
            </asp:UpdateProgress>
            </td>
             <td align="left" valign="top">
                 &nbsp;</td></tr>
        <tr>
        <td width="30%" height="500" valign="top" align="left">
         <asp:UpdatePanel ID="updpnlTreeView" runat="server" UpdateMode="Conditional" >
            <ContentTemplate>
                   <span class="FontStyle" >Methods</span> 
                   <asp:Panel ID="Panel2" runat="server" Width="400px" Height="500px" ScrollBars="Auto" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial">
                   <asp:TreeView ID="MethodTree" runat="server"  width="92%" Height="96%" BorderStyle="None" BorderWidth="1px" ForeColor="DimGray" ShowLines="True" CssClass="FontStyle" ToolTip="Lists the web methods" Font-Bold="True">
                   </asp:TreeView>
                </asp:Panel>
            </ContentTemplate>
            
        </asp:UpdatePanel>
        </td>
        <td width="50%" height="550" valign="top">
        <asp:UpdatePanel ID="updpnlRequest" runat="server" UpdateMode="Conditional" >
            <ContentTemplate>
            <table>
                <tr><span class="FontStyle" >Request</span> <td align="left" ><asp:Panel ID="Panel1" runat="server" Width ="520px" Height="225px" ScrollBars="Auto" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px">
                    <asp:TreeView ID="InputTree" runat="server" width="92%" Height="96%" ShowLines="True" ForeColor="DimGray" CssClass="FontStyle" Font-Bold="True" ToolTip="Lists the Request Type for the webmethod"  >
                    </asp:TreeView>
                </asp:Panel></td></tr>
                <tr><td align="right">
               <!-- <img id="Button1" src="cooltext92010378.png" onmouseover="this.src='cooltext92010378MouseOver.png';" onmouseout="this.src='cooltext92010378.png';" onclick="fInvoke();" style="height:31px;width:55px;" /> -->
                 <input id="Button1" type="button" class="FontStyle" value="Invoke" onclick="fInvoke();" /> 
                </td>
                </tr>
                <tr><td align="left"><span class="FontStyle" >Response</span> <asp:Panel ID="Panel3" runat="server" Width ="520px" Height="220px" ScrollBars="Vertical"  BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px">
                   <asp:TreeView ID="OutPutTree" width="92%" Height="96%" runat="server" CssClass="FontStyle" ForeColor="DimGray" ShowLines="True" ToolTip="Lists the Response Type of the web method" Font-Bold="True">
                   </asp:TreeView>
                  </asp:Panel></td></tr>
            </table>
                <input id="hdnXML" type="hidden" runat="server" />
                <input id="hdnXMLClone" type="hidden" runat="server" />
                <input id="hdnNodeValues" type="hidden" runat="server" />
                <input id="hdnParam" type="hidden" runat="server"  />
                <input id="hdnErrorMessage" type="hidden" runat="server"  />
                 <input id="hdnMethodName" type="hidden" runat="server"  />
                 <input id="hdnURL" type="hidden" runat="server"  />
                 <input id="hdnArrayFields" type="hidden" runat="server"  />
                 <input id="hdnEnumFields" type="hidden" runat="server"  />
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="MethodTree" EventName ="SelectedNodeChanged" />
            </Triggers>
        </asp:UpdatePanel>
      </td> 
      <td width="20%" height="550" valign="top" align="left">
      <br /><span class="FontStyle" >Name</span><br />
      <input id="txtNodeText" class="FontStyle" type="text" style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none" readonly="readOnly"  /><br /><br />
      
       
      <div id="divArray" style="display:none;">
      <span class="FontStyle"  id="spanArrayLength" >Length</span><br />
      <input id="txtArrayLength" class="FontStyle" type="text" style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none" onchange="fUpdateArrayField(this.value);" /><br /><br />
      </div>
      
      <div id="divValue" style="display:none;">
      <span class="FontStyle" >Set Value</span><br />
      <input id="txtValue"  class="FontStyle" type="text" onchange="fUpdateFieldValue(this.value);" /><br /><br />
      </div>
      <div id="divEnum" style="display:none;">
      <span class="FontStyle" >Select Value</span><br />
      <select id="selectEnum" class="FontStyle" onchange="fUpdateFieldValue(this.value);"><option  selected="selected"></option>
          </select>
      </div>
          <input id="txtXPath" type="hidden"    />
      </td>
      </tr>
     </table>  
    </ContentTemplate>
    <HeaderTemplate>
        Invoke
    </HeaderTemplate>
    </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanelSend" runat="server" HeaderText="TabPanel2" CssClass="visoft__tab_xpie7" width="1000px" Height="550px">
            <HeaderTemplate>
                Send
            </HeaderTemplate>
            <ContentTemplate>
            <asp:UpdateProgress ID="UpdateProgress2" runat="server" DisplayAfter="0" AssociatedUpdatePanelID="updpnlSend">
                <ProgressTemplate>
                    &nbsp;<asp:Image ID="Image2" runat="server" ImageUrl="~/loading.gif" />
                </ProgressTemplate>
            </asp:UpdateProgress>
                    <asp:UpdatePanel ID="updpnlSend" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                        <table width="1000">
                        <tr>
                            <td width="600" valign="top" align="left" ><span class="FontStyle" >
                                Soap Action</span>  <asp:TextBox ID="txtSoapAction" CssClass="FontStyle" runat="server" width="600px" ReadOnly="True"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td width="600" valign="top" align="left"><span class="FontStyle" >Request</span> <asp:TextBox ID="txtRequest" CssClass="FontStyle" runat="server" width="600px" Height="200px" TextMode="MultiLine" ></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td align="right" width="600" >
                            <!-- <img id="btnSend" src="cooltext92012936.png" onmouseover="this.src='cooltext92012936MouseOver.png';" onmouseout="this.src='cooltext92012936.png';" onclick="fSendRequest();" style="height:31px;width:80px;" /> -->
                            <input id="btnCreateSample" class="FontStyle" type="button" value="Create Sample Request" onclick="fCreateSampleRequest();" /> 
                            <input id="btnSend" class="FontStyle" type="button" value="Send" onclick="fSendRequest();" /> 
                            </td>
                        </tr>
                        <tr>
                            <td width="600"valign="top" align="left" ><span class="FontStyle" >Response</span> <asp:TextBox ID="txtResponse" CssClass="FontStyle" runat="server" width="600px" Height="200px" TextMode="MultiLine" ></asp:TextBox></td>
                        </tr>
                        </table>
              </ContentTemplate>
           </asp:UpdatePanel>
           </ContentTemplate>
         </cc1:TabPanel>
          <cc1:TabPanel ID="TabPanelWsdl" runat="server" HeaderText="TabPanelWsdl">
           <HeaderTemplate>
                    WSDL Description
                 </HeaderTemplate>
                  <ContentTemplate>
                     <asp:UpdatePanel ID="updpnlWsdl" runat="server" UpdateMode="Conditional">
                         <ContentTemplate>
                             <asp:TextBox ID="txtWsdl" runat="server" Height="550px" Width="1000px" CssClass="FontStyle" TextMode="MultiLine" BackColor="White" ReadOnly="True" Font-Bold="True" ForeColor="Gray"  ></asp:TextBox>
                         </ContentTemplate>
                     </asp:UpdatePanel>
                 </ContentTemplate>
          </cc1:TabPanel>
             <cc1:TabPanel ID="TabPanelProxy" runat="server" HeaderText="TabPanelProxy" CssClass="visoft__tab_xpie7" width="1000px" Height="550px">
                 <HeaderTemplate>
                     Client Proxy
                 </HeaderTemplate>
                 <ContentTemplate>
                     <asp:UpdatePanel ID="updpnlClientProxy" runat="server" UpdateMode="Conditional">
                         <ContentTemplate>
                             <asp:TextBox ID="txtClientProxy" runat="server" Height="550px" Width="1000px" CssClass="FontStyle" TextMode="MultiLine" BackColor="White" ReadOnly="True" Font-Bold="True" ForeColor="DimGray"  ></asp:TextBox>
                         </ContentTemplate>
                     </asp:UpdatePanel>
                     <br />
                 
                 
                 </ContentTemplate>
             </cc1:TabPanel>
             <cc1:TabPanel ID="TabPanelSearch" runat="server" HeaderText="TabPanelSearch" width="1000px" Height="550px">
                 <HeaderTemplate>
                     SOLAR Knowledge Base
                 </HeaderTemplate>
                 <ContentTemplate>
                 <table width="500">
                 <tr>
                 <td width="75%">
                     <asp:TextBox ID="txtSearch" runat="server" CssClass="FontStyle" Width="98%" ToolTip="Enter a search string such as error code or error message. Supports Wildcards such as *"></asp:TextBox>
                 </td>
                 <td width="20%">
                     <input id="btnSearch" type="button" value="Search"  class="FontStyle" onclick="fSearch();" tabindex="1" />
                 </td>
                 <td width="5%" align="left" ><asp:UpdateProgress ID="UpdateProgress3" runat="server" DisplayAfter="0" AssociatedUpdatePanelID="updpnlSearchResult">
                            <ProgressTemplate>
                                &nbsp;<asp:Image ID="Image3" runat="server" ImageUrl="~/loading.gif" />
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                 </td>
                 </tr>
                 </table>
                     <br />
                     <asp:UpdatePanel ID="updpnlSearchResult" runat="server" UpdateMode="Conditional">
                         <ContentTemplate>
                             <asp:Panel ID="pnlSearchResults" runat="server" Height="90%" Width="93%" BorderColor="#8080FF" BorderStyle="Solid" BorderWidth="1px" ScrollBars="Both">
                             
                             </asp:Panel>
                         </ContentTemplate>
                     </asp:UpdatePanel>
                 </ContentTemplate>
             </cc1:TabPanel>
            
        </cc1:TabContainer>
        <table>
        <tr>
        <td width="20%" align="left">
        <asp:HyperLink ID="HyperLink1" CssClass="FontStyle1" runat="server" NavigateUrl="https://solar.aexpdev.extra.aexp.com/" ForeColor="Black" >SOLAR Web Service Registry</asp:HyperLink></td>
        <td width="20%" align="left">
        </td>
        <td></td>
        </tr>
        </table>
      
   </form>
</body>
</html>
